<template>
    <div style="width: 100%;">
        <div style="padding: 50px;">
        <div>
            <!--        以下代码是搜索选项框的展示-->
            <el-row :gutter="20" style="height: 30px">
                <el-form ref="form" label-width="80px">

                    <el-col :span="6">
                        <div>
                            <el-form-item label-width="auto">
                                <el-input v-model="form_search.person_name" placeholder="客户姓名或外出日期" size="mini"></el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                    <el-col :span="1">
                        <div>
                            <el-form-item label-width="auto" >
                                <el-button type="primary" @click="search_go_out_by_name()" size="mini">查询</el-button>
                            </el-form-item>
                        </div>
                    </el-col>
                    <el-col :span="5">
                        <div>
                            <el-form-item label-width="auto" >
                                <el-button @click="new_go_out_dialog_visible=true" size="mini"><i class="el-icon-plus"></i>登记</el-button>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-form>
            </el-row>

            <el-divider></el-divider>
            <!--        以下代码是外出信息单号列表的展示-->
            <template>
                <el-table
                        :data="go_out_list"
                        style="width: 100%"
                        highlight-current-row
                        size="mini"
                >
                    <el-table-column
                            prop="id"
                            label="单号"
                    >
                    </el-table-column>
                    <el-table-column
                            prop="name"
                            label="客户姓名"
                    >
                    </el-table-column>
                    <el-table-column
                            prop="gender"
                            label="性别">
                    </el-table-column>
                    <el-table-column
                            prop="age"
                            label="年龄">
                    </el-table-column>
                    <el-table-column
                            prop="file_number"
                            label="档案号"
                            width="100px"
                    >
                    </el-table-column>
                    <el-table-column
                            prop="reason"
                            label="外出事由">
                    </el-table-column>
                    <el-table-column
                            prop="go_out_date"
                            label="外出日期"
                            width="100px">
                    </el-table-column>
                    <el-table-column
                            prop="go_out_time"
                            label="外出时间"
                            width="70px">
                    </el-table-column>
                    <el-table-column
                            prop="due_date"
                            label="预计回院日期"
                            width="100px">
                    </el-table-column>
                    <el-table-column
                            prop="due_time"
                            label="预计回院时间"
                            width="100px">
                    </el-table-column>
                    <el-table-column
                            prop="actual_date"
                            label="实际回院日期"
                            width="100px">
                    </el-table-column>
                    <el-table-column
                            prop="actual_time"
                            label="实际回院时间"
                            width="100px">
                    </el-table-column>
                    <el-table-column
                            prop="accompany"
                            label="陪同人">
                    </el-table-column>
                    <el-table-column
                            prop="relationship"
                            label="与老人关系">
                    </el-table-column>
                    <el-table-column
                            prop="tel"
                            label="陪同人电话"
                            width="100px">
                    </el-table-column>
                    <el-table-column
                            prop="approval_status"
                            label="审批状态">
                    </el-table-column>
                    <el-table-column
                            prop="approver"
                            label="审批人">
                    </el-table-column>
                    <el-table-column
                            prop="approval_time"
                            label="审批时间">
                    </el-table-column>
                    <el-table-column
                            prop="remark"
                            label="备注">
                    </el-table-column>
                    <el-table-column fixed="right" label="操作" width="230">
                        <template slot-scope="scope">
                            <el-button @click="handleDetailDialogOpen(scope.row)" type="text" size="mini">查看详情 </el-button>
                            <el-button @click="handleChangeDialogOpen(scope.row)" type="text" size="mini">修改</el-button>
                            <el-button @click="handleReturnDialogOpen(scope.row)" type="text" size="mini" style="color: mediumseagreen">登记回院时间</el-button>
                            <el-button @click="handleDelete(scope.row)" type="text" size="small" style="color: orangered"
                                    v-show="use_go_out_record_delete">删除</el-button>
                            <!--                        注意这里的scope.row直接就包含了所有的数据-->
                        </template>
                    </el-table-column>
                </el-table>
            </template>

            <el-row style="float: right;margin: 0">
                <label>当前为第{{page_select.current_page}}页，共计{{page_select.total_page}}页</label>
                <el-form :inline="true">
                    <el-form-item>
                        <el-button type="primary" icon="el-icon-arrow-left" @click="decrease_page()" size="mini">上一页</el-button>
                        <el-button type="primary" @click="increase_page()" size="mini">下一页<i class="el-icon-arrow-right el-icon--right"></i></el-button>
                        <el-input type="primary" placeholder="请输入页码" style="max-width: 120px"
                                  v-model="page_select.page_input" size="mini"
                        ></el-input>
                        <el-button type="primary" @click="change_page()" size="mini">Go!</el-button>


                    </el-form-item>


                </el-form>
            </el-row>
<!--            -->
<!--            -->
            <!--        以下是外出登记的dialog界面-->
<!--            -->
<!--            -->
            <el-dialog ref="new_go_out_dialog"
                       title="外出登记"
                       :visible.sync="new_go_out_dialog_visible"
                       width="30%"
                       style="min-width: 600px"
            >
            <span>
                <el-divider></el-divider>
                <el-form ref="new_go_out_dialog_form"
                         :model="new_go_out_dialog_data"
                         label-width="120px"
                         size="mini"
                         :rules="new_go_out_dialog_rules">
                    <el-form-item label="客户姓名:" prop="name">
                        <el-input v-model="new_go_out_dialog_data.name" placeholder="请输入【客户姓名】信息"></el-input>
                    </el-form-item>
                    <el-form-item label="客户身份证号:" prop="identify_number">
                        <el-input v-model="new_go_out_dialog_data.identify_number" placeholder="请输入【身份证号】信息"></el-input>
                    </el-form-item>
                    <el-form-item label="外出事由:" prop="reason">
                        <el-input v-model="new_go_out_dialog_data.reason" placeholder="请输入【外出事由】信息"></el-input>
                    </el-form-item>
                    <el-form-item label="外出日期:" prop="go_out_date" >
                        <el-date-picker type="date" placeholder="选择外出日期" v-model="new_go_out_dialog_data.go_out_date"
                                            style="width: 100%;" value-format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="外出时间:" prop="go_out_time">
                        <el-time-picker placeholder="选择外出时间" v-model="new_go_out_dialog_data.go_out_time"
                                        style="width: 100%;" value-format="HH:mm:ss">
                        </el-time-picker>
                    </el-form-item>
                    <el-form-item label="预计回院日期:" prop="due_date">
                        <el-date-picker type="date" placeholder="选择日期" v-model="new_go_out_dialog_data.due_date"
                                            style="width: 100%;" value-format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="预计回院时间:" prop="due_time">
                        <el-time-picker placeholder="选择时间" v-model="new_go_out_dialog_data.due_time"
                                        style="width: 100%;" value-format="HH:mm:ss">
                        </el-time-picker>
                    </el-form-item>
                    <el-form-item label="陪同人:" prop="accompany">
                        <el-input v-model="new_go_out_dialog_data.accompany" placeholder="请输入【陪同人】信息"></el-input>
                    </el-form-item>
                    <el-form-item label="与老人关系:" prop="relationship">
                        <el-input v-model="new_go_out_dialog_data.relationship" placeholder="请输入【与老人关系】信息"></el-input>
                    </el-form-item>
                    <el-form-item label="陪同人电话:" prop="tel">
                        <el-input v-model="new_go_out_dialog_data.tel" placeholder="请输入【陪同人电话】信息"></el-input>
                    </el-form-item>
                    <el-form-item label="备注:" prop="remark">
                        <el-input v-model="new_go_out_dialog_data.remark" placeholder="请输入【备注】信息"></el-input>
                    </el-form-item>
                    <el-button type="warning" @click="new_go_out_dialog_reset('checkin_input_form')" >清空</el-button>
                </el-form>
                <el-divider></el-divider>
            </span>
                <span slot="footer" class="dialog-footer">
            <el-button @click="new_go_out_dialog_visible=false">取 消</el-button>
            <el-button type="primary" @click="handle_new_go_out_dialog_submit('new_go_out_dialog_form')">确 定</el-button>
        </span>
                <!--            -->
                <!--            -->
                <!--        以下是外出登记记录修改的dialog界面-->
                <!--            -->
                <!--            -->
            </el-dialog>
            <el-dialog ref="change_go_out_dialog"
                       title="外出登记记录修改"
                       :visible.sync="change_go_out_dialog_visible"
                       width="30%"
                       style="min-width: 600px"
            >
            <span>
                <el-divider></el-divider>
                <el-form ref="change_go_out_dialog_form"
                         :model="change_go_out_dialog_data"
                         label-width="120px"
                         size="mini"
                         :rules="change_go_out_dialog_rules">

                    <el-form-item label="外出事由:" prop="reason">
                        <el-input v-model="change_go_out_dialog_data.reason" placeholder="请输入【外出事由】信息"></el-input>
                    </el-form-item>
                    <el-form-item label="外出日期:" prop="go_out_date">
                        <el-date-picker type="date" placeholder="选择外出日期" v-model="change_go_out_dialog_data.go_out_date"
                                        style="width: 100%;" value-format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="外出时间:" prop="go_out_time">
                        <el-time-picker placeholder="选择外出时间" v-model="change_go_out_dialog_data.go_out_time"
                                        style="width: 100%;" value-format="HH:mm:ss">
                        </el-time-picker>
                    </el-form-item>
                    <el-form-item label="预计回院日期:" prop="due_date">
                        <el-date-picker type="date" placeholder="选择日期" v-model="change_go_out_dialog_data.due_date"
                                        style="width: 100%;" value-format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="预计回院时间:" prop="due_time">
                        <el-time-picker placeholder="选择时间" v-model="change_go_out_dialog_data.due_time"
                                        style="width: 100%;" value-format="HH:mm:ss">
                        </el-time-picker>
                    </el-form-item>
                    <el-form-item label="陪同人:" prop="accompany">
                        <el-input v-model="change_go_out_dialog_data.accompany" placeholder="请输入【陪同人】信息"></el-input>
                    </el-form-item>
                    <el-form-item label="与老人关系:" prop="relationship">
                        <el-input v-model="change_go_out_dialog_data.relationship" placeholder="请输入【与老人关系】信息"></el-input>
                    </el-form-item>
                    <el-form-item label="陪同人电话:" prop="tel">
                        <el-input v-model="change_go_out_dialog_data.tel" placeholder="请输入【陪同人电话】信息"></el-input>
                    </el-form-item>
                    <el-form-item label="备注:" prop="remark">
                        <el-input v-model="change_go_out_dialog_data.remark" placeholder="请输入【备注】信息"></el-input>
                    </el-form-item>
                </el-form>
                <el-divider></el-divider>
            </span>
                <span slot="footer" class="dialog-footer">
            <el-button @click="change_go_out_dialog_visible=false">取 消</el-button>
            <el-button type="primary" @click="handle_change_go_out_dialog_submit('change_go_out_dialog_form')">确 定</el-button>
        </span>
                <!--            -->
                <!--            -->
                <!--        以下是回院登记的dialog界面-->
                <!--            -->
                <!--            -->
            </el-dialog>
            <el-dialog ref="return_time_dialog"
                       title="请输入回院时间"
                       :visible.sync="return_time_dialog_visible"
                       width="30%"
                       style="min-width: 600px"
            >
                <span>
                    <el-form
                            :rules="return_dialog_rules"
                            :model="return_dialog_data"
                            ref="return_form">
                        <el-form-item prop="return_date">
                            <el-date-picker type="date" placeholder="选择日期" v-model="return_dialog_data.return_date"
                                        style="width: 100%;" value-format="yyyy-MM-dd">
                            </el-date-picker>
                        </el-form-item>
                        <el-form-item prop="return_time">
                            <el-time-picker placeholder="选择时间" v-model="return_dialog_data.return_time"
                                            style="width: 100%;" value-format="HH:mm:ss"></el-time-picker>
                        </el-form-item>
                    </el-form>
                </span>
                <span slot="footer" class="dialog-footer">
                    <el-button @click="return_time_dialog_visible = false">取 消</el-button>
                    <el-button type="primary" @click="handleReturnDialogSubmit('return_form')">确 定</el-button>
                </span>
            </el-dialog>
<!--            -->
<!--            -->
            <!--        以下是查看老人外出详细信息的dialog界面-->
<!--            -->
<!--            -->
            <el-dialog
                    title="详情概览"
                    :visible.sync="detail_dialog_visible"
                    width="40%"
                    style="min-width: 800px">
                <el-descriptions class="margin-top" title="" :column="2" border>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-tickets"></i>
                            单号
                        </template>
                        {{detail_dialog_data.id}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            客户姓名
                        </template>
                        {{detail_dialog_data.name}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user-solid"></i>
                            客户性别
                        </template>
                        {{detail_dialog_data.gender}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user-solid"></i>
                            年龄
                        </template>
                        {{detail_dialog_data.age}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-date"></i>
                            外出日期
                        </template>
                        {{detail_dialog_data.go_out_date}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-time"></i>
                            外出时间
                        </template>
                        {{detail_dialog_data.go_out_time}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-date"></i>
                            预计回院日期
                        </template>
                        {{detail_dialog_data.due_date}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-time"></i>
                            预计回院时间
                        </template>
                        {{detail_dialog_data.due_time}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-date"></i>
                            实际回院日期
                        </template>
                        {{detail_dialog_data.actual_date}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-time"></i>
                            实际回院时间
                        </template>
                        {{detail_dialog_data.actual_time}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-files"></i>
                            档案号
                        </template>
                        {{detail_dialog_data.file_number}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            陪同人
                        </template>
                        {{detail_dialog_data.accompany}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-user"></i>
                            与老人关系
                        </template>
                        {{detail_dialog_data.relationship}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-phone"></i>
                            陪同人电话
                        </template>
                        {{detail_dialog_data.tel}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-star-off"></i>
                            审批状态
                        </template>
                        {{detail_dialog_data.approval_status}}
                    </el-descriptions-item>
                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-time"></i>
                            审批时间
                        </template>
                        {{detail_dialog_data.approval_time}}
                    </el-descriptions-item>

                    <el-descriptions-item>
                        <template slot="label">
                            <i class="el-icon-tickets"></i>
                            备注
                        </template>
                        {{detail_dialog_data.remark}}
                    </el-descriptions-item>

                </el-descriptions>
            </el-dialog>

        </div></div>
    </div>
</template>

<script>
    import qs from 'qs'
    import axios from "axios";

    export default {
        name: "checkin",
        components: {},
        mounted(){
          this.search_go_out_by_name();
        },
        data(){
            return{
                form_search:{
                    person_name:'',

                },
                go_out_list:[],
                page_select:{
                    current_page:1,
                    search_type:1,
                    total_page:1,
                    page_input:'',
                },

                return_time_dialog_visible:false,
                return_dialog_data:{
                    return_time:'',
                    return_date:'',
                    chosen_record:'',
                },
                return_dialog_rules:{
                    return_time:[{required: true, message: '请输入回院时间', trigger: 'blur' }],
                    return_date:[{required: true, message: '请输入回院日期', trigger: 'blur' }],
                },

                new_go_out_dialog_visible:false,
                new_go_out_dialog_data:{
                    name:'',
                    identify_number:'',
                    reason:'',
                    go_out_date:'',
                    go_out_time:'',
                    due_date:'',
                    due_time:'',
                    accompany:'',
                    relationship:'',
                    tel:'',
                    remark:'',
                },
                new_go_out_dialog_rules:{
                    name:[{required: true, message: '请输入客户姓名', trigger: 'blur' }],
                    identify_number:[{required: true, message: '请输入身份证号', trigger: 'blur' }],
                    reason:[{required: true, message: '请输入外出事由', trigger: 'blur' }],
                    go_out_date:[{required: true, message: '请输入外出日期', trigger: 'blur' }],
                    go_out_time:[{required: true, message: '请输入外出时间', trigger: 'blur' }],
                    due_date:[{required: true, message: '请输入预计回院日期', trigger: 'blur' }],
                    due_time:[{required: true, message: '请输入预计回院时间', trigger: 'blur' }],
                    accompany:[{required: false, message: '请输入陪同人', trigger: 'blur' }],
                    relationship:[{required: false, message: '请输入与来人关系', trigger: 'blur' }],
                    tel:[{required: false, message: '请输入陪同人联系电话', trigger: 'blur' }],
                    remark:[{required: false, message: '请输入备注', trigger: 'blur' }],
                },

                change_go_out_dialog_visible:false,
                change_go_out_dialog_data:{
                    id:'',
                    reason:'',
                    go_out_date:'',
                    go_out_time:'',
                    due_date:'',
                    due_time:'',
                    accompany:'',
                    relationship:'',
                    tel:'',
                    remark:'',
                },
                change_go_out_dialog_rules:{
                    reason:[{required: true, message: '请输入外出事由', trigger: 'blur' }],
                    go_out_date:[{required: true, message: '请输入外出日期', trigger: 'blur' }],
                    go_out_time:[{required: true, message: '请输入外出时间', trigger: 'blur' }],
                    due_date:[{required: true, message: '请输入预计回院日期', trigger: 'blur' }],
                    due_time:[{required: true, message: '请输入预计回院时间', trigger: 'blur' }],
                    accompany:[{required: false, message: '请输入陪同人', trigger: 'blur' }],
                    relationship:[{required: false, message: '请输入与来人关系', trigger: 'blur' }],
                    tel:[{required: false, message: '请输入陪同人联系电话', trigger: 'blur' }],
                    remark:[{required: false, message: '请输入备注', trigger: 'blur' }],
                },
                detail_dialog_visible:false,
                detail_dialog_data:{

                },


                use_go_out_record_delete:true,
            }
        },
        methods: {
            search_go_out_by_name() {
                let obj={
                    "search_key":this.$data.form_search.person_name,
                    "page":this.$data.page_select.current_page,
                };
                axios({
                    method:'post',
                    url:'/api/go_out_page/search_go_out_record',
                    data:qs.stringify(obj),
                }).then(res=>{
                   // console.log(res.data);
                   //  this.$data.go_out_list=res.data.goOutLists;
                   //  this.$data.page_select.total_page=res.data.total_page;
                    if(res.data.rs===true){
                        this.$data.go_out_list=res.data.data.goOutLists;
                        this.$data.page_select.total_page=res.data.data.total_page;
                    }else {
                        this.$data.go_out_list=[];
                        this.$data.page_select.total_page=1;
                        this.$message({
                            type: 'error',
                            message: '搜索失败：'+res.data.errMsg,
                        });
                    }
                });
            },
            handleChangeDialogOpen(row) {
                this.$data.change_go_out_dialog_visible=true;
                this.$data.change_go_out_dialog_data.id=row.id;
                this.$data.change_go_out_dialog_data.reason=row.reason;
                this.$data.change_go_out_dialog_data.go_out_date=row.go_out_date;
                this.$data.change_go_out_dialog_data.go_out_time=row.go_out_time;
                this.$data.change_go_out_dialog_data.due_date=row.due_date;
                this.$data.change_go_out_dialog_data.due_time=row.due_time;
                this.$data.change_go_out_dialog_data.accompany=row.accompany;
                this.$data.change_go_out_dialog_data.relationship=row.relationship;
                this.$data.change_go_out_dialog_data.tel=row.tel;
                this.$data.change_go_out_dialog_data.remark=row.remark;
            },
            handleDetailDialogOpen(row){
                this.$data.detail_dialog_visible=true;
                this.$data.detail_dialog_data=row;
            },
            handle_change_go_out_dialog_submit(form_name){
                this.$refs[form_name].validate((valid) => {
                    if (valid) {
                        this.$confirm('是否确认修改?', '提示', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            type: 'warning'
                        }).then(() => {
                            axios({
                                method:'post',
                                url:'/api/go_out_page/change_go_out_record',
                                data:qs.stringify(this.$data.change_go_out_dialog_data),
                            }).then(res=>{
                                if(res.data.rs===true) {
                                    this.$message({
                                        type: 'success',
                                        message: '修改成功!',
                                    });
                                    this.$data.change_go_out_dialog_visible = false;
                                    this.search_go_out_by_name();
                                }else{
                                    this.$message({
                                        type: 'error',
                                        message: '修改失败：'+res.data.errMsg,
                                    });
                                }
                            });
                        }).catch(() => {
                            this.$message({
                                type: 'info',
                                message: '已取消修改'
                            });
                        });
                    } else {
                        return false;
                    }
                });
            },
            handle_new_go_out_dialog_submit(form_name){
                this.$refs[form_name].validate((valid) => {
                    if (valid) {
                        this.$confirm('是否确认登记?', '提示', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            type: 'warning'
                        }).then(() => {
                            axios({
                                method:'post',
                                url:'/api/go_out_page/new_go_out_record',
                                data:qs.stringify(this.$data.new_go_out_dialog_data),
                            }).then(res=>{
                                if(res.data.rs===true) {
                                    this.$message({
                                        type: 'success',
                                        message: '登记成功!',
                                    });
                                    this.$data.new_go_out_dialog_visible = false;
                                    this.search_go_out_by_name();
                                }else{
                                    this.$message({
                                        type: 'error',
                                        message: '登记失败：'+res.data.errMsg,
                                    });
                                }
                            });
                        }).catch(() => {
                            this.$message({
                                type: 'info',
                                message: '已取消登记'
                            });
                        });
                    } else {
                        return false;
                    }
                });
            },
            handleDelete(row) {
                this.$confirm('此操作将永久删除该条信息, 是否继续?', '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    axios({
                        method:'post',
                        url:'/api/go_out_page/delete_record',
                        data:qs.stringify({"id":row.id}),
                    }).then(res=>{
                        if(res.data.rs===true) {
                            this.$message({
                                type: 'success',
                                message: '删除成功!',
                            });
                            this.search_go_out_by_name();
                        }else{
                            this.$message({
                                type: 'error',
                                message: '删除失败：'+res.data.errMsg,
                            });
                        }
                    });
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });
                });
            },
            handleReturnDialogOpen(row){
                this.$data.return_time_dialog_visible=true;
                this.$data.return_dialog_data.chosen_record=row.id;
            },
            handleReturnDialogSubmit(form_name){
                this.$refs[form_name].validate((valid) => {
                    if (valid) {
                        this.$confirm('是否确认?', '提示', {
                            confirmButtonText: '确定',
                            cancelButtonText: '取消',
                            type: 'warning'
                        }).then(() => {
                            let obj={
                                "return_time":this.$data.return_dialog_data.return_time,
                                "return_date":this.$data.return_dialog_data.return_date,
                                "id":this.$data.return_dialog_data.chosen_record,
                            }
                            axios({
                                method:'post',
                                url:'/api/go_out_page/return',
                                data:qs.stringify(obj),
                            }).then(res=>{
                                if(res.data.rs===true) {
                                    this.$message({
                                        type: 'success',
                                        message: '修改成功!',
                                    });
                                    this.$data.return_time_dialog_visible = false;
                                    this.search_go_out_by_name();
                                }else{
                                    this.$message({
                                        type: 'error',
                                        message: '修改失败：'+res.data.errMsg,
                                    });
                                }
                            });
                        }).catch(() => {
                            this.$message({
                                type: 'info',
                                message: '已取消修改'
                            });
                        });
                    } else {
                        return false;
                    }
                });
            },
            handleCurrentChange() {
            },
            change_page(){
                let num=parseInt(this.$data.page_select.page_input);
                if(isNaN(num)){
                    alert("请输入正确的数字！");
                    this.$data.page_select.page_input='';
                }else if(num<=0){
                    alert("请输入正整数！");
                    this.$data.page_select.page_input='';
                }else{
                    this.$data.page_select.current_page=num;
                    this.search_go_out_by_name();
                }
            },
            increase_page(){
                this.$data.page_select.current_page++;
                this.search_go_out_by_name();
            },
            decrease_page(){
                if(this.$data.page_select.current_page>1){
                    this.$data.page_select.current_page--;
                }
                this.search_go_out_by_name();
            },
            new_go_out_dialog_reset(form_name){
                this.$refs[form_name].resetFields();
            },
        }

    }
</script>

<style scoped>

</style>